function formatMessage(httpStatus, msg, ...rest) {
  const obj = {};
  for (const i in rest[0]) {
    obj[i] = rest[0][i];
  }
  return { httpStatus, msg, ...obj };
}

module.exports = formatMessage;
